package com.cloud.business.service.sys;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cloud.business.entity.sys.SysRole;
import com.cloud.business.model.commonvm.DeletePost;
import com.cloud.business.model.commonvm.ResultMsg;
import com.cloud.business.model.sys.sysrolevm.SysRoleQueryModel;
import com.cloud.business.model.sys.sysrolevm.SysRoleVm;
import com.cloud.business.model.sys.sysrolevm.UpdateRoleUsersPost;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 系统角色 服务类
 * </p>
 *
 * @author dh
 * @since 2020-03-21
 */
public interface ISysRoleService {

    /**
     * 分页列表
     *
     * @param sysRoleQueryModel
     * @param page
     * @param msg
     * @throws Exception
     */
    void getListByPage(SysRoleQueryModel sysRoleQueryModel, IPage<SysRoleVm> page, ResultMsg msg) throws Exception;

    /**
     * 创建
     *
     * @param sysRole
     * @return
     * @throws Exception
     */
    Integer create(SysRole sysRole, ResultMsg msg) throws Exception;

    /**
     * 更新
     *
     * @param sysRole
     * @return
     * @throws Exception
     */
    Integer update(SysRole sysRole, ResultMsg msg) throws Exception;

    /**
     * 获取单条
     *
     * @param operationId
     * @param objectId
     * @return
     * @throws Exception
     */
    SysRole getById(Integer operationId, Integer objectId, ResultMsg msg) throws Exception;

    /**
     * 批量删除
     *
     * @param deletePost
     * @return
     * @throws Exception
     */
    int deleteByList(DeletePost deletePost, ResultMsg msg) throws Exception;

    /**
     * 更新角色用户
     * @param updateRoleUsersPost
     * @param msg
     * @return
     * @throws Exception
     */
    Boolean updateRoleUsers(UpdateRoleUsersPost updateRoleUsersPost, ResultMsg msg) throws Exception;

    /**
     * 获取用户的权限code
     * @param operationId
     * @param userId
     * @param msg
     * @return
     * @throws Exception
     */
    List<Map> getSysRoleCode(Integer operationId, Integer userId, ResultMsg msg) throws Exception;


}
